<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="stylesheet" href="http://www.petercorke.com/RVC/common/toolboxhelp.css">
    <title>M-File Help: tr2rpy</title>
  </head>
  <body>
  <table border="0" cellspacing="0" width="100%">
    <tr class="subheader">
      <td class="headertitle">M-File Help: tr2rpy</td>
      <td class="subheader-left"><a href="matlab:open tr2rpy">View code for tr2rpy</a></td>
    </tr>
  </table>
<h1>tr2rpy</h1><p><span class="helptopic">Convert a homogeneous transform to roll-pitch-yaw angles</span></p><p>
<strong>rpy</strong> = <span style="color:red">tr2rpy</span>(<strong>T</strong>, <strong>options</strong>) are the roll-pitch-yaw angles (1x3)
corresponding to the rotation part of a homogeneous transform <strong>T</strong>. The 3
angles <strong>rpy</strong>=[R,P,Y] correspond to sequential rotations about the Z, Y and
X axes respectively. Roll and yaw angles in [-pi,pi) while pitch angle
in [-pi/2,pi/2).

</p>
<p>
<strong>rpy</strong> = <span style="color:red">tr2rpy</span>(<strong>R</strong>, <strong>options</strong>) as above but the input is an orthonormal
rotation matrix <strong>R</strong> (3x3).

</p>
<p>
If <strong>R</strong> (3x3xK) or <strong>T</strong> (4x4xK) represent a sequence then each row of <strong>rpy</strong>
corresponds to a step of the sequence.

</p>
<h2>Options</h2>
<table class="list">
  <tr><td style="white-space: nowrap;" class="col1"> 'deg'</td> <td>Compute angles in degrees (radians default)</td></tr>
  <tr><td style="white-space: nowrap;" class="col1"> 'xyz'</td> <td>Return solution for sequential rotations about X, Y, Z axes</td></tr>
  <tr><td style="white-space: nowrap;" class="col1"> 'zyx'</td> <td>Return solution for sequential rotations about Z, Y, X axes (default)</td></tr>
  <tr><td style="white-space: nowrap;" class="col1"> 'yxz'</td> <td>Return solution for sequential rotations about Y, X, Z axes</td></tr>
  <tr><td style="white-space: nowrap;" class="col1"> 'arm'</td> <td>Return solution for sequential rotations about X, Y, Z axes</td></tr>
</table>
<p>
'vehicle'  Return solution for sequential rotations about Z, Y, X axes

</p>
<table class="list">
  <tr><td style="white-space: nowrap;" class="col1"> 'camera'</td> <td>Return solution for sequential rotations about Y, X, Z axes</td></tr>
</table>
<h2>Notes</h2>
<ul>
  <li>There is a singularity for the case where P=pi/2 in which case R is arbitrarily
set to zero and Y is the sum (R+Y).</li>
  <li>Translation component is ignored.</li>
  <li>Toolbox rel 8-9 has XYZ angle sequence as default.</li>
  <li>'arm', 'vehicle', 'camera' are synonyms for 'xyz', 'zyx' and 'yxz'
respectively.</li>
</ul>
<h2>See also</h2>
<p>
<a href="rpy2tr.html">rpy2tr</a>, <a href="tr2eul.html">tr2eul</a></p>
<hr>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
  <tr class="subheader" valign="top"><td>&nbsp;</td></tr></table>
<p class="copy">&copy; 1990-2014 Peter Corke.</p>
</body></html>